#ifndef __INKLUDE_C_NETWORK_CLIENT_FACTORY_H__
#define __INKLUDE_C_NETWORK_CLIENT_FACTORY_H__

#include <Inklude/ikCTcpClient.h>
#include <Inklude/ikCUdpClient.h>
#include <Inklude/ikCTcpServer.h>
#include <memory>

namespace Inklude
{
    namespace NET_OPTION
    {
        enum net_option
        {
            TCP_ASYNC = 1004,
            UDP_ASYNC = 1005,
            TCP_SYNC = 1006,
            UDP_SYNC = 1007
        };
    }
    /*!
    * @brief This factory class resturns an instance of a type of connection
    *        ( e.g., tcp sync, tcp async, udp sync, udp async )
    * @author Seokhwan Kim, IPLAB, Dept. of CS., Univ. of Tsukuba
    * @date Nov, 2011
    * @remark One of NET_OPTION enum is used as a parameter.
    */ 
    class INKLUDE_CLASS_EXPORT ikCNetClientFactory
    {
    public:
        /*!
        * @brief     It returns an instance of connection you want to create.
        * @param[in] Option It designates which type of connection you want to create.
        * @return    std::shared_ptr<ikINetClient> A smart pointer contaning an instance.
        * @remark    It returns smart pointer, currently it is tested under MS Visual studio 2010 (with sp1). with MS windows 7 with sp1.
        */
        static std::shared_ptr<ikINetClient> CreateClient(int Option)
        {
            std::shared_ptr<ikINetClient> retVal;
            switch (Option)
            {
            case NET_OPTION::TCP_ASYNC:
                retVal.reset(new ikCTcpClientASync);
                break;
            case NET_OPTION::UDP_ASYNC:
                retVal.reset(new ikCUdpClientAsync);
                break;
            case NET_OPTION::TCP_SYNC:
                retVal.reset(new ikCTcpClientSync);
                break;
            case NET_OPTION::UDP_SYNC:
                retVal.reset(new ikCUdpClientSync);
                break;
            default :
                retVal = NULL;
                break;

            }
            return retVal;
        }
    };
}

#endif // __INKLUDE_C_NETWORK_CLIENT_FACTORY_H__

